const changeVal = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex }) => {
  // console.log(column.field, ' column.field')
  // console.log(row, ' row')
  const $grid = this.$refs.xGrid
  const colField = $grid.getColumnByField('fisjingneijingwai')
  const colFieldFyongjinjine = $grid.getColumnByField('fyongjinjine')
  const colFieldFyongjinbl = $grid.getColumnByField('fyongjinbl')

  const colFieldFisryrq = $grid.getColumnByField('fisryrq') // fisryrq ICER版本（燃气或者燃油版）开始

  const colFieldFisscr = $grid.getColumnByField('fisscr') // fisscr 是否含SCR
  const colFieldFscrlowup = $grid.getColumnByField('fscrlowup') // fscrlowup 含SCR低高硫

  const colFieldFisegr = $grid.getColumnByField('fisegr') // fisegr 是否含EGR
  const colFieldFegrlowup = $grid.getColumnByField('fegrlowup') // fegrlowup 含EGR低高硫

  // fisyaokongsys 是否借船厂遥控系统
  // fisykstyunfei // 借遥控系统运费
  const colFieldFisykstyunfei = $grid.getColumnByField('fisykstyunfei')
  console.log(column, ' column')
  console.log(colField, ' colField')
  // console.log(row[column.field], ' row[column.field]')
  // fyongjinjine  佣金金额(元)
  // fisyongjinbl 佣金
  console.log(column.field, column.frepcap, ' column.frepcap')
  switch (column.field) {
    case 'fisyongjinbl':// 是否佣金比例
      if (row[column.field] === '无') {
        colField.editRender.options = [
          { label: '无', value: '无' }
        ]
        this.$set(row, 'fisjingneijingwai', '无') // 境内/境外佣金
        this.$set(row, 'fyongjinbl', 0) // 佣金比例
        this.$set(row, 'fyongjinjine', 0) // 佣金金额(元)
        colFieldFyongjinjine.editRender.props.disabled = true
        colFieldFyongjinbl.editRender.props.disabled = true
      } else {
        colField.editRender.options = [
          { label: '境内', value: '境内' },
          { label: '境外', value: '境外' }
        ]
        this.$set(row, 'fisjingneijingwai', '')
        if (row[column.field] === '比例') {
          this.$set(row, 'fyongjinjine', 0)
          colFieldFyongjinjine.editRender.props.disabled = true
          colFieldFyongjinbl.editRender.props.disabled = false
          // 佣金金额(元)  禁止编辑 设置为0
        } else if (row[column.field] === '金额') {
          this.$set(row, 'fyongjinbl', 0)
          colFieldFyongjinjine.editRender.props.disabled = false
          colFieldFyongjinbl.editRender.props.disabled = true
        }
      }
      break
      //
    case 'fisryrq': // ICER版本（燃气或者燃油版）开始
      switch (row[column.field]) {
        case '无':
          colFieldFisscr.editRender.options = [
            { label: 'HPSCR', value: 'HPSCR' },
            { label: 'LPSCR', value: 'LPSCR' },
            { label: '否', value: '否' }
          ]
          colFieldFscrlowup.editRender.options = [
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]

          colFieldFisegr.editRender.options = [
            { label: 'EcoEGR', value: 'EcoEGR' },
            { label: 'EGRBP', value: 'EGRBP' },
            { label: '否', value: '否' }
          ]
          colFieldFegrlowup.editRender.options = [
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]
          break
        default:
          colFieldFisscr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '否')
          colFieldFscrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '否')
          colFieldFisegr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisegr', '否')
          colFieldFegrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fegrlowup', '否')
          break
      }
      break
    case 'fisscr': // 是否含SCR
      switch (row[column.field]) {
        case '否':
          colFieldFscrlowup.editRender.options = [ // 含SCR低高硫
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '否')

          colFieldFisryrq.editRender.options = [ // ICER版本（燃气或者燃油版）
            { label: '燃油', value: '燃油' },
            { label: '燃气', value: '燃气' },
            { label: '无', value: '无' }
          ]

          colFieldFisegr.editRender.options = [ // 是否含EGR
            // { label: '是', value: '是' }
            { label: 'EcoEGR', value: 'EcoEGR' },
            { label: 'EGRBP', value: 'EGRBP' },
            { label: '否', value: '否' }
          ]
          // this.$set(row, 'fisegr', '是')

          colFieldFegrlowup.editRender.options = [ // 含SCR低高硫
            // { label: '低硫', value: '低硫' },
            // { label: '高硫', value: '高硫' }
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]
          // this.$set(row, 'fegrlowup', '')
          break
        default: // HPSCR  LPSCR
          colFieldFisryrq.editRender.options = [
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '无')

          colFieldFscrlowup.editRender.options = [
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' }
          ]
          this.$set(row, 'fscrlowup', '')

          colFieldFisegr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisegr', '否')

          colFieldFegrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fegrlowup', '否')
          break
      }
      break

    case 'fscrlowup': // 含SCR低高硫
      switch (row[column.field]) {
        case '否':
          colFieldFisscr.editRender.options = [ // 是否含SCR
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '否')

          colFieldFisryrq.editRender.options = [ // ICER版本（燃气或者燃油版）
            { label: '燃油', value: '燃油' },
            { label: '燃气', value: '燃气' },
            { label: '无', value: '无' }
          ]

          colFieldFisegr.editRender.options = [ // 是否含EGR
            // { label: '是', value: '是' }
            { label: 'EcoEGR', value: 'EcoEGR' },
            { label: 'EGRBP', value: 'EGRBP' },
            { label: '否', value: '否' }
          ]
          // this.$set(row, 'fisegr', '是')

          colFieldFegrlowup.editRender.options = [ // 含SCR低高硫
            // { label: '低硫', value: '低硫' },
            // { label: '高硫', value: '高硫' }
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]
          // this.$set(row, 'fegrlowup', '')
          break
        default: // 低硫  高硫
          colFieldFisryrq.editRender.options = [
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '无')

          colFieldFisscr.editRender.options = [
            { label: 'HPSCR', value: 'HPSCR' },
            { label: 'LPSCR', value: 'LPSCR' }
          ]
          this.$set(row, 'fisscr', '')

          colFieldFisegr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisegr', '否')

          colFieldFegrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fegrlowup', '否')
          break
      }
      break
      // -----------------------------------------------
    case 'fisegr': // 是否含EGR
      switch (row[column.field]) {
        case '否':
          colFieldFegrlowup.editRender.options = [ // 含EGR低高硫
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fegrlowup', '否')

          colFieldFisryrq.editRender.options = [ // ICER版本（燃气或者燃油版）
            { label: '燃油', value: '燃油' },
            { label: '燃气', value: '燃气' },
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '')

          colFieldFisscr.editRender.options = [ // 是否含SCR
            { label: 'HPSCR', value: 'HPSCR' },
            { label: 'LPSCR', value: 'LPSCR' },
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '')

          colFieldFscrlowup.editRender.options = [ // 含SCR低高硫
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '')
          break
        default: // EcoEGR  EGRBP
          colFieldFisryrq.editRender.options = [
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '无')

          colFieldFisscr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '否')

          colFieldFscrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '否')

          colFieldFegrlowup.editRender.options = [
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' }
          ]
          this.$set(row, 'fegrlowup', '')
          break
      }
      break

      // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    case 'fegrlowup': // 含EGR低高硫
      switch (row[column.field]) {
        case '否':
          colFieldFisryrq.editRender.options = [ // ICER版本（燃气或者燃油版）
            { label: '燃油', value: '燃油' },
            { label: '燃气', value: '燃气' },
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '')

          colFieldFisscr.editRender.options = [ // 是否含SCR
            { label: 'HPSCR', value: 'HPSCR' },
            { label: 'LPSCR', value: 'LPSCR' },
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '')

          colFieldFscrlowup.editRender.options = [ // 含SCR低高硫
            { label: '低硫', value: '低硫' },
            { label: '高硫', value: '高硫' },
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '')

          colFieldFisegr.editRender.options = [ // 是否含EGR
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisegr', '否')

          break
        default: // 低硫  高硫

          colFieldFisegr.editRender.options = [
            { label: 'EcoEGR', value: 'EcoEGR' },
            { label: 'EGRBP', value: 'EGRBP' }
          ]
          this.$set(row, 'fisegr', '')

          colFieldFisryrq.editRender.options = [
            { label: '无', value: '无' }
          ]
          this.$set(row, 'fisryrq', '无')

          colFieldFisscr.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fisscr', '否')

          colFieldFscrlowup.editRender.options = [
            { label: '否', value: '否' }
          ]
          this.$set(row, 'fscrlowup', '否')
          break
      }
      break
      // -------------燃气版结束---------------------
    case 'fisyaokongsys': // 是否借船厂遥控系统
      if (row[column.field] === '否') {
        this.$set(row, 'fisykstyunfei', 0)
        colFieldFisykstyunfei.editRender.props.disabled = true
      } else {
        colFieldFisykstyunfei.editRender.props.disabled = false
      }
      break
    default:
      break
  }
  // console.log({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex }, ' {row,rowIndex,$rowIndex,column,columnIndex,$columnIndex}')
}

export {
  changeVal
}
